package by.ins.webconsole.jsf.actions;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;

import by.ins.app.AppContext;
import by.ins.app.commands.AppCommandConstants;
import by.yativem.commons.console.ConsoleCommandBean;


@ManagedBean(name="taskAction")
@RequestScoped
public class TaskAction extends ActionSupport{
	
	private String taskName;
	
	public String startTask(){
		bindContextParam();
		ConsoleCommandBean b = new ConsoleCommandBean(AppCommandConstants.COMMAND_START_TASK);
		b.setParam(AppCommandConstants.COMMAND_PROP_START_TASK_NAME, taskName);
		AppContext.getAppCommnandProvider().sendCommand(b);
		return null;
	}

	public String getTaskName() {
		return taskName;
	}

	public void setTaskName(String taskName) {
		this.taskName = taskName;
	}
	
	

}
